package com.inspur.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.inspur.po.User;
import com.inspur.service.UserService;

@Controller 
@RequestMapping("/user.do")
public class UserController {
	
	@Resource
	private UserService userService;
	
	@RequestMapping(params="method=reg")
	public String reg(String name) {
		System.out.println("UserController.reg()");
		System.out.println(name);
		userService.add(name);
		return "index";
	}
	
	@RequestMapping(params="method=reg2")
	public String reg2(User user) {
		System.out.println("UserController.reg2()");
		System.out.println(user.getName());
		return "index";
	}

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	
}

